{extend name="public/base"}
{block name='main'}
<style type="text/css">
  .red {color: #FF5722!important;}
  .green {color: #5FB878!important;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
  <legend>{$menuid|getmenuname}</legend>
</fieldset>
<div class="my-btn-box">
     <span class="fr">
       <a class="layui-btn layui-btn-normal" id="btn-add">添加导航</a>
     </span>
</div>

<form class="layui-form layui-form-pane" action="">
  <table class="layui-table">
    <colgroup>
      <col width="60">
      <col width="150">
      <col width="150">
      <col width="">
      <col width="120">
      <col width="120">
      <col width="120">
      <col width="120">
      <col>
    </colgroup>
    <thead>
    <tr>
      <th>ID</th>
      <th>导航名称</th>
      <th>别名</th>
      <th>链接地址</th>
      <th>导航位置</th>
      <th>排序</th>
      <th>是否启用</th>
      <th>管理操作</th>
    </tr>
    </thead>
    <tbody id="userList">
    {volist name="list" id="val"}
      <tr>
        <td><span>{$val.id}</span></td>
        <td><span>{$val.name}</span></td>
        <td><span>{$val.alias}</span></td>
        <td><span>{$val.link}</span></td>
        <td><span>{if($val.link == 'main')}主导航{else/}底部导航{/if}</span></td>
        <td><span>{$val.ordid}</span></td>
        <td>
          <input type="checkbox" name="status" value="{$val.status}" data-uri="{:url('nav/ajax_edit',['id'=>$val.id,'field'=>'status'])}" lay-skin="switch" lay-filter="status" lay-text="启用|禁止"       {if ($val.status == 1)}checked{/if}>
        </td>
        <td><a href="javascript:;" id="edit" data-uri="{:url('nav/edit',['id'=>$val.id])}" data-title="编辑 - 免责声明"  data-id="edit" data-id="10">编辑</a> |
          <a href="javascript:;"  id="delete" data-uri="{:url('nav/delete',['id'=>$val.id])}" data-id="10">删除</a></td>
      </tr>
    {/volist}
    </tbody>

  </table>
</form>
<div id="test-laypage-demo0">
  <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-29">
    {$list|raw}
  </div>
</div>
<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
  layui.use(['layer','jquery','form','element','table'], function () {
    //参数：layui、名称、模块名、主键（删除用）
    //新增弹窗
    Oper.config.add.width = '600px';
    Oper.config.add.height = '510px';

    //编辑弹窗
    Oper.config.edit.width = '600px';
    Oper.config.edit.height = '510px';
    Oper.initList(layui, '导航', 'nav', 'id');
  });
</script>
{/block}